package com.lili.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lili.base.vo.ResultAPI;
import com.lili.pojo.User;
import com.lili.vo.request.LoginUserReq;
import com.lili.vo.request.RegisterUserReq;
import com.lili.vo.request.other.UpdatePassReqVO;
import com.lili.vo.request.admin.UserReqVO;
import com.lili.vo.request.troop.ResetPassReqVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;


public interface UserService extends IService<User> {


    /**
     * 根据条件查询
     *
     * @param vo
     */
    IPage<User> findUserByCondition(UserReqVO vo);

    /**
     * 编辑或者添加用户
     *
     * @param user
     * @return
     */
    ResultAPI<String> editUser(User user);

    ResultAPI<String> updateStatus(Integer[] ids);

    Map<String, String> login(LoginUserReq user);

    boolean deleteUser(Integer id);

    List<User> getUserByUserName(String username);

    String updateAvator(MultipartFile file, Integer userId, HttpServletRequest request);

    void updateUser(User user);

    boolean updatePass(UpdatePassReqVO vo, Integer userId);

    void logout(String token);

    Boolean resetPass(ResetPassReqVO vo);

    User getUserById(Integer id);

    String register(RegisterUserReq req);

    User getCurrent(Integer userId, HttpServletRequest request);

    User getInfo(String token, HttpServletRequest request);
}
